<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>v-bind指令</title>
    <script src="vue.js"></script>
    <style>
        .myimg {
            border: 2px solid black;
            border-radius: 50px;
        }

        .otherClass {
            border: 2px dashed pink;
            border-radius: 50px;
            transform: rotate(45deg);
        }
    </style>
</head>

<body>
    <div id="app">
        <button @click="changePic">变图</button>
        <img width="400px" v-bind:src="imagePath" :class="defaultClass" @mouseover="changeClass1"
            @mouseout="changeClass2">

    </div>

</body>

</html>
<script>
    var vm = new Vue({
        el: "#app",
        data: {
            imagePath: "images/端午节合照.jpg",
            defaultClass: "myimg"
        },
        methods: {
            changePic: function () {
                this.imagePath = "images/tt.jpg";
                
            },
            changeClass1: function () {
                this.defaultClass = "otherClass";
            },
            changeClass2: function () {
                this.defaultClass = "myimg";
            }
        }
        });
</script>